/*
 * @Author: 
 * @Date: 2025-02-07 16:00:14
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2025-02-08 17:41:00
 * @Description: 
 */
import { Controller, Get, Post, Param, Body, Del, Put ,Inject} from '@midwayjs/core';
import { MeteService } from '../service/Mete.service';
import { DPModelInfoQueryDto, DPModelInfoTypeQueryDto, DPModelInfoAddDto, DPModelInfoUpdateDto, DPModelInfoDeleteDto, DPModelInfoBatchUpdateDto } from '../dto/Mete.dto';

@Controller('/mete')
export class MeteController {
  @Inject()
  private readonly meteService: MeteService;

  // 按样本类型查询
  @Post('/findByType')
  async findByType(@Body() query: DPModelInfoTypeQueryDto) {
    return await this.meteService.findByType(query);
  }

  // 根据查询条件获取样本信息，支持分页
  @Post('/findSamples')
  async findSamples(@Body() query: DPModelInfoQueryDto) {
    return await this.meteService.findSamples(query);
  }

  // 新增样本信息
  @Post('/add')
  async addMete(@Body() params: DPModelInfoAddDto) {
    return await this.meteService.addMete(params);
  }

  // 更新样本信息
  @Put('/update/:id')
  async updateMete(@Param('id') id: number, @Body() params: DPModelInfoUpdateDto) {
    return await this.meteService.updateMete(id, params);
  }

  // 删除样本信息
  @Del('/delete')
  async deleteMete(@Body() params: DPModelInfoDeleteDto) {
    return await this.meteService.deleteMete(params);
  }

  // 批量更新样本类型
  @Put('/batch-update')
  async batchUpdateSampleType(@Body() params: DPModelInfoBatchUpdateDto) {
    return await this.meteService.batchUpdateSampleType(params);
  }
}
